package com.healthbox.appointmentservice.DTO;

import com.healthbox.appointmentservice.entity.Hospital;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author pengpeng
 * @date 2022/5/8
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "检测机构", description = "检测机构，即检测医院的基本信息")
public class HospitalDTO {
    @ApiModelProperty(value = "预约机构Id, 如果是新创建该值设为null即可", example = "1")
    private Long hospitalId;
    @ApiModelProperty(value = "检测机构名称")
    private String name;
    @ApiModelProperty(value = "检测机构地址")
    private String address;
    @ApiModelProperty(value = "检测机构对应管理员账号手机号")
    private String phone;

    public static Hospital toEntity(HospitalDTO dto) {
        return Hospital.builder()
                .hospitalId(dto.hospitalId)
                .name(dto.name)
                .address(dto.address)
                .phone(dto.phone)
                .build();
    }
}
